<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-3.4.1.min.js"></script>
    <script>
        $(function () {
           $("#tel").blur(function () {
               var n=$(this).val();
               if(n.length<11){
                   alert("您输入的手机号长度不对");
                   return false;
               }if(n.charAt(0)!='1'){
                   alert("号码开头不对");
                   return  false;
               }

           });

           $("#yanzheng").blur(function () {
               var y=$(this).val();
               if(y.length!=6){
                   alert("您输入的验证码长度不对");
                   return false;
               }
           });
        });

    </script>

</head>
<body>
<form action="jq1.html">
    <input type="number" name="tel"  id="tel">
    <input type="number" name="yanzheng" id="yanzheng">
    <input type="submit" name="sub" value="注册">

</form>
</body>
</html>
